#ifndef SERIALPORTCONNECTOR_HPP
#define SERIALPORTCONNECTOR_HPP
#include <vector>
#include "DataTypes.h"
#include "qextserialport.h"


class SerialPortConnector  : public QObject
{
//    Q_OBJECT
public:
    SerialPortConnector();
    virtual ~SerialPortConnector(){}
    bool connectPort(size_t portNumber);
    Data receive(size_t timeoutInMs);
    bool send(const Data& data);
    void storeData(QByteArray data);
private:

    Data lastmsg_;
    QextSerialPort serial;
public slots:
    void onData();
};

#endif // SERIALPORTCONNECTOR_HPP


